package com.example.ssm.service;

import com.example.ssm.dao.BasicDao;
import com.example.ssm.pojo.basicinfo.query.MessageModel_BasicQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Package: com.example.ssm.service
 * @ClassName: BasicService
 * @Author: 76470
 * @CreateTime: 2021/6/10 16:59
 * @Description:
 */
@Service
public class BasicService {
	@Autowired
	private BasicDao basicDao;
	private Integer x, y;
	public MessageModel_BasicQuery BasicQueryService(String pageSize, String pageNum){
		System.out.println ("Service接收到pageSize:"+pageSize+", pageNum:"+pageNum);//test
		x = 0 + (Integer.valueOf( pageNum ) - 1) * Integer.valueOf ( pageSize );
		y = Integer.valueOf ( pageSize );
		System.out.println ("起始值："+x+",加载值："+y);//test
		MessageModel_BasicQuery messageModel_basicQuery = new MessageModel_BasicQuery ();
		messageModel_basicQuery.setList ( basicDao.findAllByPage (x, y) );
		messageModel_basicQuery.setCount ( basicDao.countRow () );
		System.out.println ("返回值："+basicDao.findAllByPage (x, y));//test
		return messageModel_basicQuery;
	}
}
